//
//  Player.m
//
//  Created by Kevin Schewior on 04.12.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Player.h"

@implementation Player

@synthesize name,clientID,teamID;

-(id)initWithName:(NSString *)pName andClientID: (NSString*)pClientID andTeamID: (NSString*)pTeamID{
	self = [super init];
	if(self){
		name = [[NSString alloc] initWithString:pName];
		clientID = [[NSString alloc] initWithString:pClientID];		
		teamID = [[NSString alloc] initWithString:pTeamID];
	}
	return self;
}

-(id)initWithCoder:(NSCoder *)aDecoder{
  self = [super init];
  if (self) {
		name = [[NSString alloc] initWithString:[aDecoder decodeObjectForKey:@"name"]];
		clientID = [[NSString alloc] initWithString:[aDecoder decodeObjectForKey:@"clientID"]];		
		teamID = [[NSString alloc] initWithString:[aDecoder decodeObjectForKey:@"teamID"]];
  }    
  return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:name forKey:@"name"];
    [aCoder encodeObject:clientID forKey:@"clientID"];	
    [aCoder encodeObject:teamID forKey:@"teamID"];		
}

-(void)dealloc{
    [name release];
	[clientID release];
	[teamID release];
	[super dealloc];
}

@end
